﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyToHelp.Entity;
using EasyToHelp.Service;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace EasyToHelp.WEBAPI.Controllers
{
    [EnableCors("CorsPolicy")]
    [Route("api/Users")]
    public class UsersController : Controller
    {
        private readonly IUsersService users;
        public UsersController(IUsersService _users)
        {
            users = _users;
        }
        [HttpGet("GetList")]
        public IEnumerable<Users> GetList()
        {
            return users.GetUserList();
        }
        [HttpGet("GetModel/{Id}")]
        public Users GetModel(int Id=0)
        {
            return users.GetUser(Id);
        }
    }
}
